package com.gdou.teaching.mapper;

import com.gdou.teaching.dataobject.Record;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;

import java.util.HashMap;
import java.util.List;

/**
 * @author MelancholyCat
 * @date Created in 21:47 2019-07-27
 * @description UserReExperimentMapper Interface
 */
@Mapper
@Repository
public interface UserReExperimentMapper {
//    增
    int addUserReExperiment(Record record);
//    删
    boolean deleteUserReExperiment(Integer userExperimentId);
//    改
    boolean updateUserReExperiment(Record record);
//    根据学生--实验连接表id查
    Record selectUserReExperimentById(@Param("userExperimentId") int userExperimentId, @Param("offset")int offset, @Param("limit")int limit);
//    根据实验id查
    List<Record> selectUserReExperimentByExperimentId(Integer experimentId);
//    根据学生id查
    List<Record> selectUserReExperimentByUserId(String userId);
    //根据实验id和学生id查
    Record selectUserReExperimentByExperimentIdAndUserId(Integer experimentId,Integer userId);

//    根据实验成绩区间查找在指定区间的 学生--实验 记录
//    List<Record> selectUserReExperimentLimitAchievement(@Param("max")Double max, @Param("min")Double min);
//    根据实验ID查询该实验的提交人数。
    Integer getCountByExperimentId(Integer experimentId);

    List<HashMap> getAllCountGroupByCourseId();


}
